package com.wang.action;

import com.wang.entity.TbBbsComment;
import com.wang.response.ResultResponse;
import com.wang.service.TbBbsCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/bbs")
public class BbsCommentAction {
    /*
 评论
 */
    @Autowired
    private TbBbsCommentService tbbbsCommentService;

     @PostMapping("insertbbscomment")
    private ResultResponse insertbbscomment(@RequestBody TbBbsComment bbsComment) throws Exception {
        return this.tbbbsCommentService.insertbbscomment(bbsComment);
    }
    /*
     删除评论
     */
    @PostMapping("removecomment/{commentId}")
    private  ResultResponse removecomment(@PathVariable Integer commentId){
        return this.tbbbsCommentService.removecomment(commentId);
    }
    /*
     查看评论
     */
    @PostMapping("findcomment")
    private  ResultResponse findcomment(@RequestBody TbBbsComment tbBbsComment){
        return this.tbbbsCommentService.findcomment(tbBbsComment);
    }
    /*
     评论回复
     */
    @PostMapping("insertcommentreply")
    private ResultResponse insertcommentreply(@RequestBody TbBbsComment tbBbsComment) throws Exception {
        return this.tbbbsCommentService.insertcommentreply(tbBbsComment);
    }
    /*
    查看评论回复
     */
    @PostMapping("findcommentreply")
    private  ResultResponse findcommentreply(@RequestBody TbBbsComment tbBbsComment){
        return this.tbbbsCommentService.findcommentreply(tbBbsComment);
    }
    /*
    管理员查看全部评论
     */
     @PostMapping("findcommentall")
    private   ResultResponse findcommentall(@RequestBody TbBbsComment tbBbsComment){
       return this.tbbbsCommentService.findcommentall(tbBbsComment);
    }
}
